home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------
- -- Created By: Petar
- -- Description: <short_description>
- --------------------------
- --
-
- AIBehaviour.P34Idle = {
- Name = "P34Idle",
- pathname = "",
-
- -- SYSTEM EVENTS -----
- ---------------------------------------------
- OnSelected = function( self, entity )
- end,
- ---------------------------------------------
- OnSpawn = function( self, entity )
- -- called when enemy spawned or reset
- AI:CreateGoalPipe("idle_loop");
- AI:PushGoal("idle_loop","timeout",1,0.5);
- AI:PushGoal("idle_loop","lookaround",1,6);
- AI:PushGoal("idle_loop","lookaround",0,-1);
- AI:PushGoal("idle_loop","approach",1,0.5);
- AI:PushGoal("idle_loop","timeout",1,3);
- entity:SelectPipe(0,"idle_loop");
-
- AI:CreateGoalPipe("attack_threat");
- AI:PushGoal("attack_threat","run",0,1);
- AI:PushGoal("attack_threat","firecmd",0,1);
- AI:PushGoal("attack_threat","approach",0,0.5);
- AI:PushGoal("attack_threat","timeout",1,1);
- AI:PushGoal("attack_threat","strafe",0,-1);
- AI:PushGoal("attack_threat","timeout",1,1);
- AI:PushGoal("attack_threat","strafe",0,1);
- AI:PushGoal("attack_threat","timeout",1,1);
- AI:PushGoal("attack_threat","strafe",0,0);
- AI:PushGoal("attack_threat","branch",0,-5);
-
- AI:CreateGoalPipe("seek_target");
- AI:PushGoal("seek_target","run",0,1);
- AI:PushGoal("seek_target","approach",1,2);
- AI:PushGoal("seek_target","timeout",1,2);
- AI:PushGoal("seek_target","strafe",0,1);
- AI:PushGoal("seek_target","timeout",1,0.5);
- AI:PushGoal("seek_target","strafe",0,-1);
- AI:PushGoal("seek_target","timeout",1,1);
- AI:PushGoal("seek_target","strafe",0,0);
- AI:PushGoal("seek_target","lookaround",1,4);
- AI:PushGoal("seek_target","lookaround",1,4);
- AI:PushGoal("seek_target","lookaround",1,4);
-
- end,
- ---------------------------------------------
- OnActivate = function( self, entity )
- -- called when enemy receives an activate event (from a trigger, for example)
- end,
- ---------------------------------------------
- OnNoTarget = function( self, entity )
- -- called when the enemy stops having an attention target
- end,
- ---------------------------------------------
- OnPlayerSeen = function( self, entity, fDistance )
- -- called when the enemy sees a living player
- entity:SelectPipe(0,"attack_threat");
- end,
- ---------------------------------------------
- OnEnemySeen = function( self, entity )
- -- called when the enemy sees a foe which is not a living player
- end,
- ---------------------------------------------
- OnFriendSeen = function( self, entity )
- -- called when the enemy sees a friendly target
- end,
- ---------------------------------------------
- OnDeadBodySeen = function( self, entity )
- -- called when the enemy a dead body
- end,
- ---------------------------------------------
- OnEnemyMemory = function( self, entity )
- -- called when the enemy can no longer see its foe, but remembers where it saw it last
- entity:SelectPipe(0,"seek_target");
- end,
- ---------------------------------------------
- OnInterestingSoundHeard = function( self, entity )
- -- called when the enemy hears an interesting sound
- entity:SelectPipe(0,"seek_target");
- end,
- ---------------------------------------------
- OnThreateningSoundHeard = function( self, entity )
- -- called when the enemy hears a scary sound
- System:LogToConsole("THREATENING SOUND ====================================================");
- entity:SelectPipe(0,"seek_target");
- end,
- ---------------------------------------------
- OnReload = function( self, entity )
- -- called when the enemy goes into automatic reload after its clip is empty
- end,
- ---------------------------------------------
- OnGroupMemberDied = function( self, entity )
- -- called when a member of the group dies
- end,
- ---------------------------------------------
- OnNoHidingPlace = function( self, entity, sender )
- -- called when no hiding place can be found with the specified parameters
- end,
- ---------------------------------------------
- OnReceivingDamage = function ( self, entity, sender)
- -- called when the enemy is damaged
- end,
-
- }